#include <iostream>

void ch2_20 () {
  int i = 42;
  int *p1 = &i;
  *p1 = *p1 * *p1;
  std::cout << "p1=42, p1*p1=" << *p1 << std::endl;
}

void ch2_23() {
  int *p = 0;
  if (p)
    std::cout << "p = true" << std::endl;
  else
    std::cout << "p == 0" << std::endl;
}

int main(int argc, char *argv[])
{
  int *p = 0;
  int i = 2;
  std::cout << "p:" << p << std::endl;
  p = NULL;
  std::cout << "p:" << p << std::endl;
  p = &i;
  std::cout << "p:" << p << " *p:" << *p << std::endl;
  ch2_20();
  ch2_23();
  return 0;
}
